<?php

/************************************

EasyCB, Community Forum Software
Copyright (C) 2007  Jonathon D. Keogh <jonathon.keogh@gmail.com>

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.

$Id: page.user.php 40 2007-09-02 03:46:07Z jonathon.keogh $

************************************/

require "inc.func.php";

$id = isset($_GET['id']) ? $_GET['id'] : 0;
if(user_name($id) == "")
{
	page_redirect("page.boards.php");
}

$user = db_query("SELECT * FROM `" . config_get("db_prefix") . "users` WHERE `ID`='" . db_escape($id) . "';");
if(db_num_rows($user) < 1)
{
	page_redirect("page.boards.php");
}
$user = db_fetch_assoc($user);

page_header(htmlentities(user_name($id)));

page_section("About " . htmlentities(user_name($id)));
?>

<b style="font-size: 15pt;"><?=htmlentities($user['Username']) ?></b><br>
<?=$user['Title'] != "" ? "<i>" . htmlentities($user['Title']) . "</i><br>" : "" ?>
<?=$user['Name'] != "" ? "Real name: " . htmlentities($user['Name']) . "<br>" : "" ?>
<?=$user['Level'] != 0 ? "This user is a" . ($user['Level'] == 1 ? " moderator" : "n administrator") . "<br>" : "" ?>
<?=$user['PostCount'] != 0 ? "Post count: " . $user['PostCount'] . "<br>" : "This user has never posted.<br>" ?>
Member since: <?=date(config_get("DateString"), $user['RegisterTime']) ?>

<?php
page_section();

page_section();
$contact = 0;
if($user['AIM'] != "")
{
	$contact++;
	print "AIM screen name: " . htmlentities($user['AIM']) . "<br>";
}
if($user['ICQ'] != "")
{
	$contact++;
	print "ICQ number: " . htmlentities($user['ICQ']) . "<br>";
}
if($user['MSN'] != "")
{
	$contact++;
	print "MSN address: " . htmlentities($user['MSN']) . "<br>";
}
if($user['YIM'] != "")
{
	$contact++;
	print "Yahoo! screen name: " . htmlentities($user['YIM']) . "<br>";
}
if($contact == 0)
{
	print "This user hasn't listed any IM screen names.";
}
page_section();

page_footer('$Id: page.user.php 40 2007-09-02 03:46:07Z jonathon.keogh $');

?>